package lab2.text18;

/**
 * Created by Administrator on 2017/10/26.
 */
public class Text {
    public static void main(String[] args) {
        String name="My name is Network crazy";
        System.out.println("字符串的长度："+name.length());
        System.out.println("字符串的第一个字符："+name.charAt(0));
        System.out.println("字符串的最后一个字符："+name.charAt(name.length()-1));
        String[]result=name.split(" ");//以空格的规则分割
        System.out.println("字符串的第一个单词："+result[0]);
      //  System.out.println("字符串的第一个单词："+result[0]+""+result[1]);
        System.out.println("crazy的位置："+name.indexOf("crazy"));
    }
}

